//package com.jic.manager.impl.excel;
//
//import com.alibaba.excel.context.AnalysisContext;
//import com.jic.manager.bo.StoreExcelBo;
//import com.jic.manager.entity.Mestore;
//import com.jic.manager.mapper.MerchantMapper;
//import com.jic.market.impl.excel.ExcelListener;
//import lombok.extern.slf4j.Slf4j;
//
//import javax.annotation.Resource;
//import java.util.Date;
//import java.util.List;
//
//@Slf4j
//public class StoreExcelListener extends ExcelListener {
//    @Resource
//    private MerchantMapper merchantMapper;
//
//    @Override
//    public void invoke(Object object, AnalysisContext context) {
//        log.info("---------进入StoreExcelListener----------");
//        log.info("------------------------" + object);
//        //数据存储到list，供批量处理，或后续自己业务逻辑处理。
//        List<Object> datas = super.elData.getDatas();
//
//        List<Object> datasSecond = super.elData.getDatasSecond();
//
//        StoreExcelBo bo = (StoreExcelBo) object;
//        log.info("----------bo--{}------", bo);
//        Mestore mestore = new Mestore();
//        Mestore mestore1 = new Mestore();
//          //判断是否存在第三方商家编码
////        String thirdMerchantCodes = bo.getThirdMerchantCode();
////        List<MemMerchantInfoResponse> memMerchantInfoResponses = merchantMapper.getByThirdMerchantCode(thirdMerchantCodes);
////        if (memMerchantInfoResponses != null) {
////            mestore.setStoreName(bo.getStoreName());
////            mestore.setThirdMerchantCode(bo.getThirdMerchantCode());
////            mestore.setThirdStoreCode(bo.getThirdStoreCode());
////            mestore.setBusinessProvinceId(bo.getBusinessProvinceId());
////            mestore.setBusinessCityId(bo.getBusinessCityId());
////            mestore.setBusinessRegionId(bo.getBusinessRegionId());
////            mestore.setStoreTypes(bo.getStoreTypes());
////            mestore.setAddressDetail(bo.getAddressDetail());
////            mestore.setCreateTime(new Date());
////            mestore.setDeleteFlag("0");
////            datas.add(mestore);
////        }else {
////            mestore1.setStoreName(bo.getStoreName());
////            mestore1.setThirdMerchantCode(bo.getThirdMerchantCode());
////            mestore1.setThirdStoreCode(bo.getThirdStoreCode());
////            mestore1.setBusinessProvinceId(bo.getBusinessProvinceId());
////            mestore1.setBusinessCityId(bo.getBusinessCityId());
////            mestore1.setBusinessRegionId(bo.getBusinessRegionId());
////            mestore1.setStoreTypes(bo.getStoreTypes());
////            mestore1.setAddressDetail(bo.getAddressDetail());
////            mestore1.setCreateTime(new Date());
////            mestore1.setDeleteFlag("0");
////            datasSecond.add(mestore1);
////        }
//        mestore.setStoreName(bo.getStoreName());
//        mestore.setThirdMerchantCode(bo.getThirdMerchantCode());
//        mestore.setThirdStoreCode(bo.getThirdStoreCode());
//        mestore.setBusinessProvinceId(bo.getBusinessProvinceId());
//        mestore.setBusinessCityId(bo.getBusinessCityId());
//        mestore.setBusinessRegionId(bo.getBusinessRegionId());
//        mestore.setStoreTypes(bo.getStoreTypes());
//        mestore.setAddressDetail(bo.getAddressDetail());
//        mestore.setCreateTime(new Date());
//        mestore.setDeleteFlag("0");
//        datas.add(mestore);
//
//        //根据业务自行 do something
//        doSomething();
//
//        /*
//        如数据过大，可以进行定量分批处理
//        if(datas.size()<=100){
//            datas.add(object);
//        }else {
//            doSomething();
//            datas = new ArrayList<Object>();
//        }
//         */
//    }
//
//
//    /**
//     * 根据业务自行实现该方法
//     */
//    private void doSomething() {
//        log.info("doSomethingdoSomethingdoSomethingdoSomethingdoSomethingdoSomething");
//    }
//
//    @Override
//    public void doAfterAllAnalysed(AnalysisContext context) {
//        /*
//            datas.clear();
//            解析结束销毁不用的资源
//         */
//    }
//}
